package com.yanchangapp.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yanchangapp.R;
import com.yanchangapp.model.bean.RecordProductBean;
import com.zxl.baselib.util.formatter.BigDecimalUtils;
import com.zxl.baselib.util.ui.ResHelper;

import java.util.List;

/**
 * Created by apple on 2019-08-30.
 * description: 订单内部产品的adapter...
 */
public class RdInnerProductAdapter extends BaseQuickAdapter<RecordProductBean, BaseViewHolder> {

    public RdInnerProductAdapter(int layoutResId, @Nullable List<RecordProductBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, RecordProductBean item) {
        // 设置产品名称 ...
        helper.setText(R.id.tvProductName,item.getProductName());
        // 设置采购信息等...
        helper.setText(R.id.tvProductSum, ResHelper.getString(R.string.inner_product,item.getPurchaseNum(), BigDecimalUtils.keep2Decimal(item.getPrice())));
    }
}
